<template>
	<view class="flex align-center border-top fixed-bottom bg-white" style="height: 100rpx;">
		<input class="flex-1 bg-light ml-2 p-1 rounded" type="text" v-model="content" :focus="focus" placeholder="文明发言"
			@confirm="submit()" @blur="$emit('blur')"/>
		<view class="iconfont icon-fabu font-lg flex justify-center align-center animated "
			hover-class="jello text-main" style="width: 100rpx; height: 100rpx;" @click="submit">
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			focus:{
				type:Boolean,
				default:false
			}
		},
		data(){
			return{
				content:''
			}
		},
		methods:{
			submit(){
				if (this.content === '') {
					uni.showToast({
						title: '消息不能为空',
						icon: 'none'
					});
					return
				}
				this.$emit('submit',this.content)
				this.content = ''
			}
		}
	}
</script>

<style>
</style>
